#ifndef SMARTCAR_HPP
#define SMARTCAR_HPP

#include <string>
#include <vector>

using namespace std;

class Tire {
private:
    string type;
    int size;

public:
    void set(const string& tire_type = "公路轮、麦克纳姆轮", int tire_size = 175);
    void print() const;
    void save(ofstream& file) const;
};

class Chassis {
private:
    string id;
    string model;
    int wheelbase;
    int track;
    int min_ground_clearance;
    int min_turning_radius;
    string drive_type;
    int max_range;
    vector<Tire> tires;

public:
    void set(const string& chassis_id, const string& chassis_model = "SCOUT MINI", int chassis_wheelbase = 451, int chassis_track = 490,
             int ground_clearance = 115, int turning_radius = 0, const string& drive = "四轮四驱", int range = 10);
    void print() const;
    void save(ofstream& file) const;
    string get() const;
};

class AGX {
private:
    string model;
    int AI;
    int GPU;
    int tensor_cores;
    int vmemory;
    int storage;

public:
    void set(const string& agx_model = "AGX Xavier", int agx_AI = 32, int agx_GPU = 512, int agx_tensor_cores = 64,
             int agx_vmemory = 32, int agx_storage = 32);
    void print() const;
    void save(ofstream& file) const;
};

class DualCamera {
private:
    string model;
    string camera;
    string resolution;
    int fps;
    string fov;
    int depth_fps;

public:
    void set(const string& camera_model = "RealSense D435i", const string& camera_type = "D430", const string& camera_resolution = "1920x1080",
             int camera_fps = 30, const string& camera_fov = "87x58", int camera_depth_fps = 90);
    void print() const;
    void save(ofstream& file) const;
};

class Lidar {
private:
    string model;
    int channels;
    int range;
    int power;

public:
    void set(const string& lidar_model = "RS-Helios-16p", int lidar_channels = 16, int lidar_range = 100, int lidar_power = 8);
    void print() const;
    void save(ofstream& file) const;
};

class IMU {
private:
    string model;
    string manufacturer;
public:
    void set(const string& imu_model = "CH110", const string& imu_manufacturer = "NXP");
    void print() const;
    void save(ofstream& file) const;
};

class Screen {
private:
    double size;
    string model;

public:
    void set(double screen_size = 11.6, const string& screen_model = "super");
    void print() const;
    void save(ofstream& file) const;
};

class Battery {
private:
    string params;
    string voltage;
    string charge;

public:
    void set(const string& battery_params = "24V/15Ah", const string& battery_voltage = "24V", const string& battery_charge = "2H");
    void print() const;
    void save(ofstream& file) const;
};

class SmartCar {
private:
    string id;
    Chassis chassis;
    AGX agx;
    DualCamera dual_camera;
    Lidar lidar;
    IMU imu;
    Screen screen;
    Battery battery;
public:
    void set(const string& chassis_id_);
    void setID(const string& car_id);
    void print() const;
    void save(const string& file_path) const;
    vector<string> get() const;
};
#endif // SMARTCAR_HPP
